﻿using System.Data.SqlClient;

namespace App_Code
{
    /// <summary>
    ///Shop 的摘要说明
    /// </summary>
    public class Shop
    {
        /// <summary>
        /// 直接读取给定的SqlDataReader来构造自身。注：不会调用reader.Read()。
        /// </summary>
        /// <param name="reader"></param>
        public Shop(SqlDataReader reader)
        {
            Name= reader.GetString(0);
            Description = reader.GetString(1);
        
            var cp= reader.GetSqlInt32(3);
            if (cp.IsNull)
                CoverPhoto = null;
            else
                CoverPhoto = cp.Value;

            Category = reader.GetString(2);
        }

        public string Name { get; set; }

        public string Description { get; set; }

        public int? CoverPhoto { get; set; }

        public string Category { get; set; }
    }
}